import { createRouter, createWebHistory } from 'vue-router'

const routes = [
    {
        path: '/',
        redirect: '/login'
    },
    {
        path: '/login',
        name: 'login',
        // 使用懒加载方式导入注册组件
        component: () => import('@/views/login.vue')
    },
    {
        path: '/register',
        name: 'register',
        // 使用懒加载方式导入注册组件
        component: () => import('@/views/register.vue')
    },
    {
        path: '/businessInfo',
        name: 'businessInfo',
        // 使用懒加载方式导入注册组件
        component: () => import('@/views/businessInfo.vue')
    },
    {
        path: '/businessList',
        name: 'businessList',
        // 使用懒加载方式导入注册组件
        component: () => import('@/views/businessList.vue')
    }
    ,
    {
        path: '/index',
        name: 'index',
        // 使用懒加载方式导入注册组件
        component: () => import('@/views/index.vue')
    }
    ,
    {
        path: '/order',
        name: 'order',
        // 使用懒加载方式导入注册组件
        component: () => import('@/views/order.vue')
    }
    ,
    {
        path: '/orderList',
        name: 'orderList',
        // 使用懒加载方式导入注册组件
        component: () => import('@/views/orderList.vue')
    }
    ,
    {
        path: '/payment',
        name: 'payment',
        // 使用懒加载方式导入注册组件
        component: () => import('@/views/payment.vue')
    }

]

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes,
})


export default router
